﻿<%@ Page Title="Quản lí bậc lương" Language="C#" MasterPageFile="~/Views/MasterPageViews.master"
    AutoEventWireup="true" CodeFile="Salaries.aspx.cs" Inherits="Views_Salaries" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<asp:Content ID="ContentHeader" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="ContentChange" ContentPlaceHolderID="ContentPlaceHolderChange" runat="Server">
    <h3 class="header-title">
        <ext:Label StyleHtmlCls="lable-message" StyleHtmlContent="true" ID="lblHeader" runat="server"
            Text="Quản lí bậc lương " Icon="ApplicationOsxCascade" />
    </h3>
    <div class="content-sub">
        <ext:Toolbar ID="ToolbarFunctions" runat="server">
            <Items>
                <ext:Button ID="btnToobarAdd" runat="server" Text="Thêm mới" Icon="Add" OnDirectClick="btnToobarAdd_DirectClick" />
                <ext:Button ID="btnToobarUpdate" runat="server" Text="Chỉnh sửa" Icon="Pencil" OnDirectClick="btnToobarUpdate_DirectClick" />
                <ext:Button ID="btnToobarDelete" runat="server" Text="Xóa" Icon="Delete" OnDirectClick="btnToobarDelete_DirectClick" />
                <ext:Button ID="btnToobarHelp" runat="server" Text="Hỗ trợ" Icon="Help" />
            </Items>
        </ext:Toolbar>

        <!--Store find data-->
        <ext:Store ID="StoreSalaries" runat="server" OnReadData="StoreSalaries_ReadData"
            PageSize="30">
            <Sorters>
                <ext:DataSorter Direction="ASC" Property="SaLevID" />
            </Sorters>
            <Model>
                <ext:Model ID="ModelSalaries" runat="server" IDProperty="SaLevID">
                    <Fields>
                        <ext:ModelField Name="SaLevID" />
                        <ext:ModelField Name="NameOfSalary" />
                        <ext:ModelField Name="Code" />
                        <ext:ModelField Name="LevelSalary" />
                        <ext:ModelField Name="NumberSalary" />
                        <ext:ModelField Name="Descriptons" />
                        <ext:ModelField Name="StatusOfLevel" />
                    </Fields>
                </ext:Model>
            </Model>
        </ext:Store>

        <!--Content data-->
        <ext:GridPanel
            ID="gridPanelSalaries"
            runat="server"
            StoreID="StoreSalaries"
            Height="510"
            Title="Danh sách bậc lương"
            BodyStyle="background-image: url('../Themes/bg-main.png')">
            <ColumnModel ID="ColumnModelSalaries" runat="server">
                <Columns>
                    <ext:RowNumbererColumn ID="RowNumbererColumnProvince" Width="30" Text="STT" runat="server" />
                    <ext:Column ID="Col_SaLevID" runat="server" Text="ID" DataIndex="SaLevID" Hidden="true" />
                    <ext:Column ID="Col_NameOfSalary" runat="server" Text="Ngạch công chức " DataIndex="NameOfSalary" Flex="1" />
                    <ext:Column ID="Col_Code" runat="server" Text="Mã công chức" DataIndex="Code" />
                    <ext:Column ID="Col_LevelSalary" runat="server" Text="Bậc Lương" DataIndex="LevelSalary" />
                    <ext:Column ID="Col_NumberSalary" runat="server" Text="Hệ số lương" DataIndex="NumberSalary" />
                    <ext:Column ID="Col_Descriptons" runat="server" Text="Mô tả" DataIndex="Descriptons" />
                    <ext:CheckColumn ID="Col_StatusOfLevel" runat="server" Text="Trạng thái" DataIndex="StatusOfLevel" />
                </Columns>
            </ColumnModel>
            <SelectionModel>
                <ext:RowSelectionModel ID="RowSelectionModelSalaries" runat="server" Mode="Single">
                    <DirectEvents>
                        <Select OnEvent="RowSelected" Buffer="250" />
                    </DirectEvents>
                </ext:RowSelectionModel>
            </SelectionModel>
            <BottomBar>
                <ext:PagingToolbar ID="PagingToolbarSalaries" runat="server" StoreID="StoreSalaries"
                    AfterPageText="của {0}" BeforePageText="Trang" DisplayMsg="Hiển thị bản ghi {0} - {1} của {2}"
                    EmptyMsg="Chưa có dữ liệu" FirstText="Trang đầu tiên" LastText="Trang cuối cùng"
                    NextText="Trang kế tiếp" PrevText="Trang trước" RefreshText="Làm mới" />
            </BottomBar>
        </ext:GridPanel>
    </div>
    <!-- Cửa sổ popup thêm bậc lương -->
    <ext:Window
        ID="windowAddSalaries"
        runat="server"
        Title="Thêm mới bậc lương"
        Icon="Add"
        Height="310"
        Width="350"
        Modal="true"
        ShadowMode="Drop"
        Hidden="true"
        Resizable="false"
        BodyStyle="background-image: url('../Themes/bg-main.png')">
        <Loader runat="server" Mode="Frame">
            <LoadMask ShowMask="true" />
        </Loader>
        <Content>
            <ext:Toolbar ID="ToolbarAddSalaries" runat="server">
                <Items>
                    <ext:Button ID="btnAdd" runat="server" Text="Lưu lại" Icon="Disk" OnDirectClick="btnAdd_DirectClick" />
                    <ext:Button ID="btnAddCancel" runat="server" Text="Hủy bỏ" Icon="Delete" OnDirectClick="btnAddCancel_DirectClick" />
                </Items>
            </ext:Toolbar>
            <div class="content-popup-style">
                <div class="view-msg-popup">
                    <ext:Label ID="lblFormAddMsg" runat="server" StyleHtmlContent="True" Cls="lable-message-error" />
                </div>
                <div>
                    <ext:TextField ID="txtFormAddCode" runat="server" FieldLabel="Mã công chức" Width="310"
                        MarginSpec="5 0 5 0" />
                    <ext:TextField ID="txtFormAddNameOfSalary" runat="server" FieldLabel="Ngạch công chức"
                        Width="310" MarginSpec="5 0 5 0" />
                    <ext:TextField ID="txtFormAddLevelSalary" runat="server" FieldLabel="Bậc lương" Width="310"
                        MarginSpec="5 0 5 0" Height="22">
                        <Plugins>
                            <ext:InputMask ID="InputAddMaskLeveSal" runat="server" Mask="9.99">
                                <MaskSymbols>
                                    <ext:MaskSymbol Name="AddmaskLeve" Regex="[1-10]" />
                                </MaskSymbols>
                            </ext:InputMask>
                        </Plugins>
                    </ext:TextField>
                    <ext:TextField ID="txtFormAddNumberSalary" runat="server" FieldLabel="Hệ số lương"
                        Width="310" MarginSpec="5 0 5 0" Height="22">
                        <Plugins>
                            <ext:InputMask ID="InputAddMasknumber" runat="server" Mask="9.99">
                                <MaskSymbols>
                                    <ext:MaskSymbol Name="addMaskNumber" Regex="[1-10]" />
                                </MaskSymbols>
                            </ext:InputMask>
                        </Plugins>
                    </ext:TextField>
                    <ext:TextArea ID="txtFormAddDescriptons" runat="server" FieldLabel="Mô tả" Width="310"
                        MarginSpec="5 0 5 0" />
                    <ext:Checkbox ID="chkFormAddStatusOfLevel" runat="server" FieldLabel="Trạng thái"
                        BoxLabel="Cho phép hoạt động" />
                </div>
            </div>
        </Content>
    </ext:Window>
    <!-- Cửa sổ popup cập nhật bậc lương -->
    <ext:Window
        ID="windowUpdateSalaries"
        runat="server" 
        Title="Cập nhật bậc lương" 
        Icon="Pencil"
        Height="310" 
        Width="350" 
        BodyStyle="background-image: url('../Themes/bg-main.png')" 
        Modal="true" 
        ShadowMode="Drop"
        Hidden="true">
        <Content>
            <ext:Toolbar ID="Toolbar1" runat="server">
                <Items>
                    <ext:Button ID="btnUpdate" runat="server" Text="Lưu lại" Icon="Disk" OnDirectClick="btnUpdate_DirectClick" />
                    <ext:Button ID="btnUpdateCancel" runat="server" Text="Hủy bỏ" Icon="Delete" OnDirectClick="btnUpdateCancel_DirectClick" />
                </Items>
            </ext:Toolbar>
            <div class="content-popup-style">
                <div class="view-msg-popup">
                    <ext:Label ID="lblFormUpdateMsg" runat="server" StyleHtmlContent="True" Icon="None"
                        Cls="lable-message-error" />
                </div>
                <div>
                    <ext:TextField ID="txtFormUpdateCode" runat="server" FieldLabel="Mã công chức" Width="310"
                        MarginSpec="5 0 5 0" />
                    <ext:TextField ID="txtFormUpdateNameOfSalary" runat="server" FieldLabel="Ngạch công chức"
                        Width="310" MarginSpec="5 0 5 0" />
                    <ext:TextField ID="txtFormUpdateLevelSalary" runat="server" FieldLabel="Bậc lương"
                        Width="310" MarginSpec="5 0 5 0">
                        <Plugins>
                            <ext:InputMask ID="inputMaskUpdateLevels" runat="server" Mask="9.99">
                                <MaskSymbols>
                                    <ext:MaskSymbol Name="maskLevelsUpdate" Regex="[1-10]" />
                                </MaskSymbols>
                            </ext:InputMask>
                        </Plugins>
                    </ext:TextField>
                    <ext:TextField ID="txtFormUpdateNumberSalary" runat="server" FieldLabel="Hệ số lương"
                        Width="310" MarginSpec="5 0 5 0">
                        <Plugins>
                            <ext:InputMask ID="inputMaskUpdateNumber" runat="server" Mask="9.99">
                                <MaskSymbols>
                                    <ext:MaskSymbol Name="maskNumberUpdate" Regex="[1-10]" />
                                </MaskSymbols>
                            </ext:InputMask>
                        </Plugins>
                    </ext:TextField>
                    <ext:TextArea ID="txtFormUpdateDescriptons" runat="server" FieldLabel="Mô tả" Width="310"
                        MarginSpec="5 0 5 0" />
                    <ext:Checkbox ID="chkFormUpdateStatusOfLevel" runat="server" FieldLabel="Trạng thái"
                        BoxLabel="Cho phép hoạt động" />
                </div>
            </div>
        </Content>
    </ext:Window>
    <!-- Hiển thị thông tin chi tiết -->
    <div class="view-info-record">
        <h3 class="header-title">
            <ext:Label ID="lblHeaderViewInfomations" StyleHtmlCls="lable-message" StyleHtmlContent="true"
                runat="server" Text="Hiển thị thông tin" Icon="Information" />
        </h3>
        <div class="content-info">
            <table>
                <tr>
                    <td class="with-td-view-info">ID:
                    </td>
                    <td>
                        <ext:Label ID="lblViewSaLevID" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td class="with-td-view-info">Mã công chức:
                    </td>
                    <td>
                        <ext:Label ID="lblViewCode" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td class="with-td-view-info">Ngạch công chức:
                    </td>
                    <td>
                        <ext:Label ID="lblViewNameOfSalary" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td class="with-td-view-info">Bậc lương:
                    </td>
                    <td>
                        <ext:Label ID="lblViewLevelSalary" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td class="with-td-view-info">Hệ số lương:
                    </td>
                    <td>
                        <ext:Label ID="lblViewNumberSalary" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td class="with-td-view-info">Mô tả:
                    </td>
                    <td>
                        <ext:Label ID="lblViewDescriptons" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td class="with-td-view-info">Trạng thái:
                    </td>
                    <td>
                        <ext:Checkbox ID="chkViewStatusStatusOfLevel" runat="server" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
</asp:Content>
